class MyRange:
    def __init__(self, start, end):
        self.start = start
        self.end = end

    def __iter__(self):
        while self.start < self.end:
            yield self.start
            self.start += 1


for element in MyRange(0, 5):
    print(element)
